#
# CCOData.py
#
# Cataloging Cultural Object (CCO) Data models
# <http://www.vrafoundation.org/ccoweb/index.htm>
#
# This collection of models and properties use the CIDOC CRM ontology to
# enrich the FRBR base models and to provide interoperability with other
# CIDOC systems.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Copyright 2009- Jeremy Nelson, Tomichi Informatics LLC

import datetime,os
import MODSData

from basedata import *
from google.appengine.ext import db
from google.appengine.api import users

#===============================================================================#
# Properties                                                                    #
#===============================================================================#

#===============================================================================#
# Models                                                                        #
#===============================================================================#
class Work(BaseModel):
    ''' Models a physical object. '''
    titles = db.ListProperty(db.Key,
                             default=None)
    types = db.ListProperty(db.Key,
                            default=None)

    def get_titles(self):
        return self.get_collection(property_name="titles")
    

class WorkTypes(db.Model):
    ''' Supporting model for CCO Work model.'''
    authority = db.ReferenceProperty()
    value = db.StringProperty()
